package com.cino.demos.chain;

public class MainTest {
    public static void main(String[] args) {
        FilterChain chain = new FilterChain();

        HttpFilter filter = new HttpFilter();
        aFilter aFilter = new aFilter();
        bFilter bFilter = new bFilter();
        chain.addFilter(filter);
        chain.addFilter(aFilter);
        chain.addFilter(bFilter);

        chain.setTarget(new My());

        //filter如何链式执行
        chain.doFilter(new Request("hello"),new Response("response"),chain);
    }
}
